package com.gitee.neuray.security.generator.configmd.biz;

import com.gitee.neuray.security.generator.projectmd.biz.TProjectInfoBiz;
import com.gitee.neuray.security.generator.projectmd.entity.TProjectInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.common.Mapper;
import com.gitee.neuray.security.common.biz.BaseBiz;

import com.gitee.neuray.security.generator.configmd.mapper.TConfigInfoMapper;
import com.gitee.neuray.security.generator.configmd.entity.TConfigInfoEntity;


@Service
@Transactional(rollbackFor = Exception.class)
public class TConfigInfoBiz extends BaseBiz<TConfigInfoMapper,TConfigInfoEntity> {
    @Autowired
    private TProjectInfoBiz projectInfoBiz;

    @Override
    protected String getPageName() {
        return "TConfigInfo"+"Biz";
    }

    @Override
    public void insertSelective(TConfigInfoEntity entity) {
        TProjectInfoEntity tProjectInfoEntity = projectInfoBiz.selectById(entity.getProjectId());
        if(tProjectInfoEntity != null){
            entity.setProjectName(tProjectInfoEntity.getProjectName());
        }
        super.insertSelective(entity);
    }
}
